package com.wtb.javatool.service;

import com.wtb.javatool.entity.Comment;
import com.wtb.javatool.entity.Favorite;
import com.wtb.javatool.entity.Resource;
import com.wtb.javatool.entity.ResourceType;
import org.springframework.stereotype.Service;

import java.io.InputStream;
import java.util.List;

@Service
public interface IResourceService {


    List<Resource> selectResourceByCourseId(Integer course_id);

    String selectResourceTypeById(Integer resource_type_id);

    List<ResourceType> resourceTypeList();

    List<Resource> selectResourseByResourseTypeId(Integer resource_type_id,Integer course_id);

    boolean uploadResource(String resource_name, Integer resource_type_id, byte[] resource_data, String size,Integer user_id,Integer course_id,String mimeType);

    Resource selectResourceDataByResourceId(Integer resource_id);

    List<Resource> selectResourseByResourseTypeIdList(List<Integer> resourceTypeIds,Integer course_id);

    Integer saveresourceFavorite(Favorite favorite);

    List<Favorite> listAllResourceFavorite(Favorite favorite);

    Integer saveResourceComment(Comment comment);

    List<Comment> listAllResourceComment(Comment comment);

    Integer addLearnersCount(Integer resource_id);

    Integer addCommentCount(Integer resource_id);

    Integer addTotalScore(Comment comment);

    Resource selectCommentCountandTotalScore(Integer resource_id);

    Integer addScore(Resource resource);

    Integer updateLikeCount(Integer resource_id);

    String selectUserNameByUserId(Integer user_id);

    InputStream  downloadResource(Integer resource_id) throws Exception;

    List<Resource> selectResourceByName(String resource_name, Integer course_id);
}